package com.xing.reggie.common;
/*
* 基于ThreadLocal封装工具类，用户保存和获取当前登录用户Id
* BaseContext作用于某一个线程内
* */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //setId
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }
    //getId
    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
